/**
 * PLM项目模拟数据配置
 * 提供统一的模拟数据源，适用于开发测试和服务器不可用情况
 */

// 模拟项目数据
const MOCK_PROJECTS = [
  {
    _id: 'mock-project-1',
    model: '风扇电机样机设计',
    cate: '霍尔',
    status: 2,
    devManager: '张工',
    bizManager: '李总',
    createTime: Math.floor(Date.now() / 1000) - 86400 * 7,
    updateTime: Math.floor(Date.now() / 1000) - 86400 * 3,
    statusUpdateTime: Math.floor(Date.now() / 1000) - 86400 * 3,
    startTime: '2025-04-01',
    endTime: '2025-07-01',
    description: '风扇电机样机设计项目，包括设计、建模和测试等工作。',
    progress: 35,
    priority: 'normal'
  },
  {
    _id: 'mock-project-2',
    model: '高效吸尘器马达',
    cate: '吸尘器',
    status: 3,
    devManager: '王工',
    bizManager: '赵总',
    createTime: Math.floor(Date.now() / 1000) - 86400 * 14,
    updateTime: Math.floor(Date.now() / 1000) - 86400 * 2,
    statusUpdateTime: Math.floor(Date.now() / 1000) - 86400 * 2,
    startTime: '2025-03-15',
    endTime: '2025-08-15',
    description: '高效节能吸尘器马达设计与制造项目。',
    progress: 50,
    priority: 'high'
  },
  {
    _id: 'mock-project-3',
    model: '智能风扇控制系统',
    cate: '风机',
    status: 4,
    devManager: '赵工',
    bizManager: '钱总',
    createTime: Math.floor(Date.now() / 1000) - 86400 * 30,
    updateTime: Math.floor(Date.now() / 1000) - 86400,
    statusUpdateTime: Math.floor(Date.now() / 1000) - 86400,
    startTime: '2025-02-20',
    endTime: '2025-06-30',
    description: '智能风扇控制系统设计，包括PWM控制、温度感应和远程控制。',
    progress: 75,
    priority: 'high'
  },
  {
    _id: 'mock-project-4',
    model: '家用水泵电机',
    cate: '水泵',
    status: 1,
    devManager: '孙工',
    bizManager: '周总',
    createTime: Math.floor(Date.now() / 1000) - 86400 * 2,
    updateTime: Math.floor(Date.now() / 1000) - 86400 * 2,
    statusUpdateTime: Math.floor(Date.now() / 1000) - 86400 * 2,
    startTime: '2025-05-01',
    endTime: '2025-09-30',
    description: '家用高效节能水泵电机设计项目。',
    progress: 10,
    priority: 'normal'
  },
  {
    _id: 'mock-project-5',
    model: '车载空调电机',
    cate: '其他',
    status: 5,
    devManager: '吴工',
    bizManager: '郑总',
    createTime: Math.floor(Date.now() / 1000) - 86400 * 60,
    updateTime: Math.floor(Date.now() / 1000) - 86400 * 5,
    statusUpdateTime: Math.floor(Date.now() / 1000) - 86400 * 5,
    startTime: '2025-01-15',
    endTime: '2025-05-15',
    description: '车载空调电机设计与测试项目。',
    progress: 90,
    priority: 'high'
  }
];

// 创建默认项目数据
function createDefaultProject(id) {
  return {
    _id: id || 'default-' + Date.now(),
    model: '默认项目',
    cate: '其他',
    status: 0,
    devManager: '未知',
    bizManager: '未知',
    createTime: Math.floor(Date.now() / 1000),
    updateTime: Math.floor(Date.now() / 1000),
    statusUpdateTime: Math.floor(Date.now() / 1000),
    startTime: new Date().toISOString().split('T')[0],
    endTime: new Date(Date.now() + 90 * 86400000).toISOString().split('T')[0],
    description: '这是一个默认项目，用于数据异常时的展示',
    progress: 0,
    priority: 'normal'
  };
}

// 导出配置
module.exports = {
  MOCK_PROJECTS,
  createDefaultProject
}; 